import { getHistorySearchList, getIsFirst, getIsOpenCamera } from '@/utils/localStorage'

/*
 * @Autor: Ruohong Yu
 * @Date: 2022-08-31 23:29:26
 * @Description: file content
 * @FilePath: \ebook\src\store\getters.js
 */
const getters = {
  fileName: state => state.book.fileName,
  menuVisible: state => state.book.menuVisible,
  settingVisible: state => state.book.settingVisible,
  defaultFontSize: state => state.book.defaultFontSize,
  defaultFontFamily: state => state.book.defaultFontFamily,
  fontFamilyVisible: state => state.book.fontFamilyVisible,
  defaultTheme: state => state.book.defaultTheme,
  bookAvailable: state => state.book.bookAvailable,
  progress: state => state.book.progress,
  section: state => state.book.section,
  isPaginating: state => state.book.isPaginating,
  currentBook: state => state.book.currentBook,
  navigation: state => state.book.navigation,
  cover: state => state.book.cover,
  metadata: state => state.book.metadata,
  paginate: state => state.book.paginate,
  pagelist: state => state.book.pagelist,
  offsetY: state => state.book.offsetY,
  isBookmark: state => state.book.isBookmark,
  handState: state => state.book.handState,
  hotSearchOffsetY: state => state.store.hotSearchOffsetY,
  flapCardVisible: state => state.store.flapCardVisible,
  isEditMode: state => state.store.isEditMode,
  shelfList: state => state.store.shelfList,
  shelfSelected: state => state.store.shelfSelected,
  shelfTitleVisible: state => state.store.shelfTitleVisible,
  shelfCategory: state => state.store.shelfCategory,
  currentType: state => state.store.currentType,
  suspendBallVisible: state => {
    state.store.suspendBallVisible = getIsOpenCamera()
    return state.store.suspendBallVisible
  },
  isFirst: state => {
    state.store.isFirst = getIsFirst()
    return state.store.isFirst
  },
  shelfType: state => state.store.shelfType,
  historySearchList: state => {
    state.store.historySearchList = getHistorySearchList()
    return state.store.historySearchList
  }
}

export default getters
